#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n,m;
ll f[25005];
ll num[105];
int main(){
	memset(f,0,sizeof f);
	f[0]=1;
	cin>>n>>m;
    for(int i=1;i<=n;++i)cin>>num[i];
    for(int i=1;i<=n;++i)
    	for(int j=m;j>=num[i];--j)
    		f[j]+=f[j-num[i]];
    cout<<f[m]<<endl;
    return 0;
}
